package com.ship.dispatch.controller;

import com.ship.common.core.base.Page;
import com.ship.common.core.web.domain.JsonResult;
import com.ship.dispatch.bean.TzFuelRecord;
import com.ship.dispatch.service.TzFuelRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.*;

/**
 * 燃油台账燃油记录 前端控制器
 *
 * @author zhangyh
 * @since 2024-01-10
 */
@RestController
@RequestMapping("/fuel/record")
@Api(value = "tzFuelRecord", tags = "燃油台账燃油记录前端控制器")
public class TzFuelRecordController {

    @Autowired
    private TzFuelRecordService tzFuelRecordService;

    /**
     * 燃油台账燃油记录分页查询
     *
     * @return
     */
    @ApiOperation(value = "燃油台账燃油记录分页查询")
    @PostMapping(value = "/page")
    public JsonResult<Page<TzFuelRecord>> getPage(@RequestBody TzFuelRecord dto) {
        return tzFuelRecordService.getPage(dto);
    }

    /**
     * 燃油台账燃油记录导出
     *
     * @return
     */
    @ApiOperation(value = "燃油台账燃油记录导出")
    @PostMapping(value = "/export")
    public JsonResult dataExport(@RequestBody TzFuelRecord dto) throws IOException {
        return tzFuelRecordService.dataExport(dto);
    }


}
